
//获取权限
import 'package:center_beijing/common/http_util.dart';

//用户登录
userLogin(params) async {
  var responseJson = await HttpUtil().post("portal/irest/base/loginHandler/checkLogin", params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}
//用户登录
userLogin2() async {
  var responseJson = await HttpUtil().post("portal/irest/base/loginHandler/keepAlive",{});
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

//用户登录
getUserInfo(params) async {
  var responseJson = await HttpUtil().post("bim/irest/base/ccbim_tbmcEmployeeHandler/getLoginUserInfo",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

getLoginId(params) async {
  var responseJson = await HttpUtil().post("portal/irest/base/loginHandler/loginAsProject", params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}



/*
* 获取用户权限
* */
getUserAuth(params) async {
  var responseJson = await HttpUtil().post("sso/irest/base/sso_loginHandler/getAllAuthByTree",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

/*
* 获取字典类型
* */
getPunishType(params) async {
  var responseJson = await HttpUtil().post("bim/irest/base/dictHandler/getItems",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}





/*
* 获取tenantId
* */
getTenantId() async {
  var responseJson = await HttpUtil().get("portal/irest/base/loginHandler/getLoginTenantId");
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

/*
* 绑定registerId
* */
bandRegisterId(params) async {
  var responseJson = await HttpUtil().post("bim/irest/base/ccbim_personHandler/savePersonApp",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}


/*
* 登录后进行操作（用来获取token）
* */
afterLogin(params) async {
  var responseJson = await HttpUtil().post("rheaservice/api/authorizations/login",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

/*
* 根据雇员ID(employeeId)获取人员信息，名称及分数
* */
getEmployeeScore(params) async {
  var responseJson = await HttpUtil().post("bim/irest/base/ccbim_employeeScoreExpenseHandler/getEmployeeScore",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

/*
* 获取商店
* */
getShops(params) async {
  var responseJson = await HttpUtil().post("bim/irest/base/ccbim_scoreShopHandler/getScoreShops",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

/*
* 保存消费
* */
saveEmployeeScoreExpense(params) async {
  var responseJson = await HttpUtil().post("bim/irest/base/ccbim_employeeScoreExpenseHandler/saveEmployeeScoreExpense",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

